package com.zhou.review3.serviceImpl;

import com.zhou.review3.entity.SysOrderDetail;
import com.zhou.review3.mapper.SysOrderDetailMapper;
import com.zhou.review3.service.SysOrderDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysOrderDetailServiceImpl implements SysOrderDetailService {
    @Autowired
    private SysOrderDetailMapper sysOrderDetailMapper;


    public List<SysOrderDetail> findAllSysOrderDetail() {
        return sysOrderDetailMapper.queryAll();
    }

    public int removeSysOrderDetail(int id) {
        return  sysOrderDetailMapper.deleteByPrimaryKey(id);
    }

    public void addSysOrderDetail(SysOrderDetail sysOrderDetail) {
        sysOrderDetailMapper.insert(sysOrderDetail);
    }

    public SysOrderDetail findSysOrderDetail(int id) {
        return  sysOrderDetailMapper.selectByPrimaryKey(id);
    }

    public void modifySysOrderDetail(SysOrderDetail newSysOrderDetail) {
        sysOrderDetailMapper.updateByPrimaryKey(newSysOrderDetail);
    }

}
